DISCUSSION
The
ATSUGetFontFeatureSelectors function obtains a list of the feature selectors that are defined for a given feature type in a font. You can use this information to set the font features and selectors in a style object.
The best way to use
ATSUGetFontFeatureSelectors is to call it twice:
-
Pass the ID of the font whose feature selectors you want to determine in the iFont parameter, NULL for the oSelectors parameter, and 0 for the other parameters. ATSUGetFontFeatureSelectors returns the size of the feature type array in the oActualSelectorCount parameter.
-
Allocate enough space for an array of the returned size, then call the function again, passing a pointer in the oSelectors parameter; on return, the pointer references the array of feature selectors for the given feature type.
-
You can also determine how much memory to allocate for the oSelectors array by calling the function ATSUCountFontFeatureSelectors, which will return the total number of font feature selectors in a particular feature type.